# file = open("./1.5_python_advence/module_exercise.py", "rb")
#
# data = file.read()
# print(data.decode())
# file.close()
#
# file = open("./1.5_python_advence/module_exercise.py", "rb")
# while True:
#     data = file.read(1)
#     if not data:
#         break
#     print(data, end='')
# file.close()

# file = open("./1.5_python_advence/module_exercise.py", "rb")
# data = file.readline()
# print(data)
# file = open("../1.5_python_advence/module_exercise.py", "rb")
# # data_list = file.readlines()
# # print(data_list)
# for line in file():
#     print(line)
# file.close()

# def find_word(word):
#     file = open("dict.txt", "r")
#     for line in file:
#         tmp = line.split(' ')[0]
#         if tmp > word:
#             print("没有这个单词")
#             file.close()
#             return
#         elif word == tmp:
#             print(line)
#             file.close()
#             return
#
# find_word(input("请输入需要查找的单词："))

# file = open("file.txt","w")
# n = file.write("hello, 死鬼\n")
# file.write("哎呀，干啥\n")
# print("写入字符数：", n)
#
# data = [
#     "接着奏乐\n",
#     "接着舞\n"
# ]
# file.writelines(data)
# file.close()

# def copy(filename):
#     """
#     将指定的文件在当前目录下复制一份
#     :param filename: 需要复制的文件名称
#     """
#     new_file = "new" + filename.split('/')[-1]
#     fr = open(filename, 'rb')
#     fw = open(new_file, 'wb')
#     while True:
#         data = fr.read(1024)
#         if not data:
#             break
#         fw.write(data)
#     fr.close()
#     fw.close()
#
# copy("zifuchuan.PNG")

# with open("dict.txt") as file:
#     data = file.read()
#     print(data)


# file = open("dict.txt", "w", buffering=1)
# while True:
#     data = input(">>")
#     if not data:
#         break
#     file.write(data)
# file.close()

# file = open("zifuchuan.PNG","wb+")
# file.write("你好！".encode("utf-8"))
# file.flush()
# file.seek(-3,2)
# data = file.read()
# print("读取：", data.decode())
# file.close()

# file = open("./my.log","a+",buffering=1)
# from time import *
# file.seek(0,0)
# n = len(file.readlines())+1
#
# while True:
#     tm = "%d.%s\n" % (n, ctime())
#     file.write(tm)
#     n += 1
#     sleep(2)
# import os
# print(os.path.getsize('zifuchuan.PNG'))
# print(os.listdir("./"))
# print(os.path.exists("./" + "zifuchuan.PNG"))
import re
# print(re.findall('ab', "abcdefabcd"))
# print(re.findall("com|cn","www.baidu.com/www.tomco.cn"))
# print(re.findall('张.丰',"张三丰，张四丰，张无丰"))
# print(re.findall('[aeiou]',"How are you!"))
# print(re.findall('[^0-9]',"Use 007 port"))
# print(re.findall('wo*', "wooooo~w!"))
# print(re.findall("[A-Z][a-z]+","Hello world"))
# print(re.findall('-?[0-9]+', "Jame, age:18, -26"))
# print(re.findall('1[]0-9]{10}', 'Jame:13843845785'))
# print(re.findall('[1-9][0-9]{5,10}',"Baron:12595459548"))
# print(re.findall('^Jame',"Jame, hello"))
# print(re.findall('Jame$', "hi, Jame"))
# print(re.findall(r'\d{1,5}',"Mysql:3306, http:80"))
# print(re.findall(r'\w+', "server_port = 8888"))
# print(re.findall(r'\w+\s+\w+', 'hello     world'))
# print(re.findall(r'\bis a\b',"This is a test"))
# result = re.findall('ab|cd', "abcdefghijklmn")
# result = re.findall('[aeiou]', "how are you")
# result = re.findall('[^A-Z]', "How are you!")
# result = re.findall('wo*', "wooooo~w!")
# result = re.findall('wo{2,4}', "wooooo~w!")
# result = re.findall(r'-?\d+\.?\d*',"-5.4 3.28 45 76.3 -21")
# result = re.search("(ab)+","abababab")
# result = re.search(r'(?P<xing>王|李)\w{1,3}', "王者荣耀")
# print(result.group())

# result = re.findall('[A-Z][a-z]*', "How are you,Jame!,I am")
# result = re.findall('[0-9]+', "今天是：2021-4-30")
# result = re.findall('-?[0-9]+',"-20°的天气，战士附中15Kg")

# print(re.search(r'(?P<pig>ab)+',"ababababababab").group('pig'))
string = "Alex:1996,Sunny:1998"
# result = re.sub(r'\W+',"##", string, count=2)
# result = re.split(r"\W+",string)
# result = re.findall(r"(\w+):(\d+)", string)
# result = re.match(r"(\w+:(?P<year>\d+))", string)
# result = re.search(r"\d+",string)
# result = re.finditer("\w+", string)
# for item in result:
#     print("匹配内容：", item.group())
#     print("所在位置：", item.span())
# # print(result.group())

"""
Input/output data rate is disabled.

tunnel-te11 is up, line protocol is up
  Interface state transitions: 3
  Hardware is Tunnel-TE
  Internet address is 192.168.0.2/32
  MTU 1500 bytes, BW 0 Kbit
     reliability 255/255, txload Unknown, rxload Unknown
  Encapsulation TUNNEL,  loopback not set,
  Last link flapped 8w0d
  Last input never, output 00:00:00
  Last clearing of "show interface" counters never
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 17000 bits/sec, 29 packets/sec
     0 packets input, 0 bytes, 0 total input drops
     0 drops for unrecognized upper-level protocol
     Received 0 broadcast packets, 0 multicast packets
     23593868 packets output, 1835278695 bytes, 0 total output drops
     Output 0 broadcast packets, 0 multicast packets

tunnel-te24 is administratively down, line protocol is administratively down
  Interface state transitions: 0
"""
def parg():
    file = open("inet.log", "r")
    while True:
        data = ""
        for line in file:
            if line == "\n":
                break
            data += line
        if data:
            yield data
        else:
            return
def main():
    port =input("端口名称：")
    for data in parg():
        head = re.match(r"\S+", data).group()
        if head == port:
            address = re.search(r"([0-9a-f]{4}\.?){3}", data).group()
            return address
    return "Not Found"
print(main())